/**********************************
 * @Author: Ronnie Zhang
 * @LastEditor: Ronnie Zhang
 * @LastEditTime: 2023/12/04 22:50:38
 * @Email: zclzone@outlook.com
 * Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
 **********************************/

import { request } from '@/utils'

export default {
  // 获取用户信息
  getUser: () => request.get('/system/user/me'),
  // 刷新token
  refreshToken: () => request.get('/auth/refresh/token'),
  // 登出
  logout: () => request.post('/auth/logout', {}, { needTip: false }),
  // 切换当前角色
  switchCurrentRole: role => request.post(`/auth/current-role/switch/${role}`),
  // 获取角色权限
  getRolePermissions: () => request.get('/system/menu/my'),
  // 验证菜单路径
  validateMenuPath: path => request.get(`/permission/menu/validate?path=${path}`),
  // ---------------------------------------------------配置信息------------------------------------------------------------
  getAppConfig: data => request.post('/system/wx/app/config/get', data),
  updateAppConfig: data => request.post(`/system/wx/app/config/update`, data),
  // ---------------------------------------------------------------------------------------------------------------
  getGoodsTagOptions: data => request.post(`/system/goods/tag/list`, data),
  // ---------------------------------------------------------------------------------------------------------------
  getEnumOptions: name => request.get(`/system/options/${name}`), // await 才生效
  // 商品详情
  getGoodsPOById: id => request.get(`/system/goods/get/${id}`),
  // 小程序
  swiperImgsList: data => request.post(`/system/swiperImgs/list`, data),
  swiperImgsAdd: data => request.post(`/system/swiperImgs/add`, data),
  swiperImgsUpdate: data => request.post(`/system/swiperImgs/update`, data),
  // 打印器
  getOrderPrinterInfo: id => request.get(`/system/orderPrinter/${id}`),
}
